import 'package:flutter/material.dart';
import 'package:untitled/scoped_model/AuthModel.dart';
import 'package:untitled/utils/common_toast.dart';
import 'package:untitled/utils/scopoed_model_helper.dart';

class SettingPage extends StatelessWidget {
  const SettingPage({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('设置'),
      ),
      body: ListView(
        children: [
          ElevatedButton(
            onPressed: () {
              //退出登录
              ScopedModelHelper.getModel<AuthModel>(context).logout();
              CommonToast.showToast("退出登录");
            },
            child: Text('退出登录'),
            style: ElevatedButton.styleFrom(
                primary: Colors.grey,//背景色
                onPrimary: Colors.red//前景色
            ),
          ),
        ],
      ),
    );
  }
}
